#!/usr/bin/env python

def sort(d, reverse=False):
    """proposed in PEP 265, using  the itemgetter, \
            http://www.python.org/dev/peps/pep-0265/"""

    from operator import itemgetter
    return sorted(d.iteritems(), key=itemgetter(1), reverse=True)

#D = dict(zip(xrange(100), xrange(100)))
D = {'a':2, 'b':23, 'c':5, 'd':17, 'e':1}

print sort(D, reverse=True)
